package com.course.app.transformer;

import com.course.app.api.data.StudentDTO;
import com.course.domain.model.Account;
import com.course.domain.model.Student;

/**
 * Created by Justin on 2017/5/30.
 */
public class StudentTransformer {

    public static StudentDTO toDTO(Student student, Account account) {
        StudentDTO studentDTO = new StudentDTO();
        studentDTO.setId(student.getId());
        studentDTO.setName(student.getName());
        studentDTO.setUsername(account.getUsername());
        studentDTO.setScore(student.getScore());
        studentDTO.setExchange(student.getExchange());
        studentDTO.setAudio(student.getAudio());
        return studentDTO;
    }
}
